/* REQUIRED PLUGINS
/* ========================================================================
/*! nanoScrollerJS - v0.8.7 - (c) 2015 James Florentino; Licensed MIT */
! function(a) {
    return "function" == typeof define && define.amd ? define(["jquery"], function(b) {
        return a(b, window, document)
    }) : "object" == typeof exports ? module.exports = a(require("jquery"), window, document) : a(jQuery, window, document)
}(function(a, b, c) {
    "use strict";
    var d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H;
    z = {
        paneClass: "nano-pane",
        sliderClass: "nano-slider",
        contentClass: "nano-content",
        iOSNativeScrolling: !1,
        preventPageScrolling: !1,
        disableResize: !1,
        alwaysVisible: !1,
        flashDelay: 1500,
        sliderMinHeight: 20,
        sliderMaxHeight: null,
        documentContext: null,
        windowContext: null
    }, u = "scrollbar", t = "scroll", l = "mousedown", m = "mouseenter", n = "mousemove", p = "mousewheel", o = "mouseup", s = "resize", h = "drag", i = "enter", w = "up", r = "panedown", f = "DOMMouseScroll", g = "down", x = "wheel", j = "keydown", k = "keyup", v = "touchmove", d = "Microsoft Internet Explorer" === b.navigator.appName && /msie 7./i.test(b.navigator.appVersion) && b.ActiveXObject, e = null, D = b.requestAnimationFrame, y = b.cancelAnimationFrame, F = c.createElement("div").style, H = function() {
        var a, b, c, d, e, f;
        for (d = ["t", "webkitT", "MozT", "msT", "OT"], a = e = 0, f = d.length; f > e; a = ++e)
            if (c = d[a], b = d[a] + "ransform", b in F) return d[a].substr(0, d[a].length - 1);
        return !1
    }(), G = function(a) {
        return H === !1 ? !1 : "" === H ? a : H + a.charAt(0).toUpperCase() + a.substr(1)
    }, E = G("transform"), B = E !== !1, A = function() {
        var a, b, d;
        return a = c.createElement("div"), b = a.style, b.position = "absolute", b.width = "100px", b.height = "100px", b.overflow = t, b.top = "-9999px", c.body.appendChild(a), d = a.offsetWidth - a.clientWidth, c.body.removeChild(a), d
    }, C = function() {
        var a, c, d;
        return c = b.navigator.userAgent, (a = /(?=.+Mac OS X)(?=.+Firefox)/.test(c)) ? (d = /Firefox\/\d{2}\./.exec(c), d && (d = d[0].replace(/\D+/g, "")), a && +d > 23) : !1
    }, q = function() {
        function j(d, f) {
            this.el = d, this.options = f, e || (e = A()), this.$el = a(this.el), this.doc = a(this.options.documentContext || c), this.win = a(this.options.windowContext || b), this.body = this.doc.find("body"), this.$content = this.$el.children("." + this.options.contentClass), this.$content.attr("tabindex", this.options.tabIndex || 0), this.content = this.$content[0], this.previousPosition = 0, this.options.iOSNativeScrolling && null != this.el.style.WebkitOverflowScrolling ? this.nativeScrolling() : this.generate(), this.createEvents(), this.addEvents(), this.reset()
        }
        return j.prototype.preventScrolling = function(a, b) {
            if (this.isActive)
                if (a.type === f)(b === g && a.originalEvent.detail > 0 || b === w && a.originalEvent.detail < 0) && a.preventDefault();
                else if (a.type === p) {
                if (!a.originalEvent || !a.originalEvent.wheelDelta) return;
                (b === g && a.originalEvent.wheelDelta < 0 || b === w && a.originalEvent.wheelDelta > 0) && a.preventDefault()
            }
        }, j.prototype.nativeScrolling = function() {
            this.$content.css({
                WebkitOverflowScrolling: "touch"
            }), this.iOSNativeScrolling = !0, this.isActive = !0
        }, j.prototype.updateScrollValues = function() {
            var a, b;
            a = this.content, this.maxScrollTop = a.scrollHeight - a.clientHeight, this.prevScrollTop = this.contentScrollTop || 0, this.contentScrollTop = a.scrollTop, b = this.contentScrollTop > this.previousPosition ? "down" : this.contentScrollTop < this.previousPosition ? "up" : "same", this.previousPosition = this.contentScrollTop, "same" !== b && this.$el.trigger("update", {
                position: this.contentScrollTop,
                maximum: this.maxScrollTop,
                direction: b
            }), this.iOSNativeScrolling || (this.maxSliderTop = this.paneHeight - this.sliderHeight, this.sliderTop = 0 === this.maxScrollTop ? 0 : this.contentScrollTop * this.maxSliderTop / this.maxScrollTop)
        }, j.prototype.setOnScrollStyles = function() {
            var a;
            B ? (a = {}, a[E] = "translate(0, " + this.sliderTop + "px)") : a = {
                top: this.sliderTop
            }, D ? (y && this.scrollRAF && y(this.scrollRAF), this.scrollRAF = D(function(b) {
                return function() {
                    return b.scrollRAF = null, b.slider.css(a)
                }
            }(this))) : this.slider.css(a)
        }, j.prototype.createEvents = function() {
            this.events = {
                down: function(a) {
                    return function(b) {
                        return a.isBeingDragged = !0, a.offsetY = b.pageY - a.slider.offset().top, a.slider.is(b.target) || (a.offsetY = 0), a.pane.addClass("active"), a.doc.bind(n, a.events[h]).bind(o, a.events[w]), a.body.bind(m, a.events[i]), !1
                    }
                }(this),
                drag: function(a) {
                    return function(b) {
                        return a.sliderY = b.pageY - a.$el.offset().top - a.paneTop - (a.offsetY || .5 * a.sliderHeight), a.scroll(), a.contentScrollTop >= a.maxScrollTop && a.prevScrollTop !== a.maxScrollTop ? a.$el.trigger("scrollend") : 0 === a.contentScrollTop && 0 !== a.prevScrollTop && a.$el.trigger("scrolltop"), !1
                    }
                }(this),
                up: function(a) {
                    return function(b) {
                        return a.isBeingDragged = !1, a.pane.removeClass("active"), a.doc.unbind(n, a.events[h]).unbind(o, a.events[w]), a.body.unbind(m, a.events[i]), !1
                    }
                }(this),
                resize: function(a) {
                    return function(b) {
                        a.reset()
                    }
                }(this),
                panedown: function(a) {
                    return function(b) {
                        return a.sliderY = (b.offsetY || b.originalEvent.layerY) - .5 * a.sliderHeight, a.scroll(), a.events.down(b), !1
                    }
                }(this),
                scroll: function(a) {
                    return function(b) {
                        a.updateScrollValues(), a.isBeingDragged || (a.iOSNativeScrolling || (a.sliderY = a.sliderTop, a.setOnScrollStyles()), null != b && (a.contentScrollTop >= a.maxScrollTop ? (a.options.preventPageScrolling && a.preventScrolling(b, g), a.prevScrollTop !== a.maxScrollTop && a.$el.trigger("scrollend")) : 0 === a.contentScrollTop && (a.options.preventPageScrolling && a.preventScrolling(b, w), 0 !== a.prevScrollTop && a.$el.trigger("scrolltop"))))
                    }
                }(this),
                wheel: function(a) {
                    return function(b) {
                        var c;
                        if (null != b) return c = b.delta || b.wheelDelta || b.originalEvent && b.originalEvent.wheelDelta || -b.detail || b.originalEvent && -b.originalEvent.detail, c && (a.sliderY += -c / 3), a.scroll(), !1
                    }
                }(this),
                enter: function(a) {
                    return function(b) {
                        var c;
                        if (a.isBeingDragged) return 1 !== (b.buttons || b.which) ? (c = a.events)[w].apply(c, arguments) : void 0
                    }
                }(this)
            }
        }, j.prototype.addEvents = function() {
            var a;
            this.removeEvents(), a = this.events, this.options.disableResize || this.win.bind(s, a[s]), this.iOSNativeScrolling || (this.slider.bind(l, a[g]), this.pane.bind(l, a[r]).bind("" + p + " " + f, a[x])), this.$content.bind("" + t + " " + p + " " + f + " " + v, a[t])
        }, j.prototype.removeEvents = function() {
            var a;
            a = this.events, this.win.unbind(s, a[s]), this.iOSNativeScrolling || (this.slider.unbind(), this.pane.unbind()), this.$content.unbind("" + t + " " + p + " " + f + " " + v, a[t])
        }, j.prototype.generate = function() {
            var a, c, d, f, g, h, i;
            return f = this.options, h = f.paneClass, i = f.sliderClass, a = f.contentClass, (g = this.$el.children("." + h)).length || g.children("." + i).length || this.$el.append('<div class="' + h + '"><div class="' + i + '" /></div>'), this.pane = this.$el.children("." + h), this.slider = this.pane.find("." + i), 0 === e && C() ? (d = b.getComputedStyle(this.content, null).getPropertyValue("padding-right").replace(/[^0-9.]+/g, ""), c = {
                right: -14,
                paddingRight: +d + 14
            }) : e && (c = {
                right: -e
            }, this.$el.addClass("has-scrollbar")), null != c && this.$content.css(c), this
        }, j.prototype.restore = function() {
            this.stopped = !1, this.iOSNativeScrolling || this.pane.show(), this.addEvents()
        }, j.prototype.reset = function() {
            var a, b, c, f, g, h, i, j, k, l, m, n;
            return this.iOSNativeScrolling ? void(this.contentHeight = this.content.scrollHeight) : (this.$el.find("." + this.options.paneClass).length || this.generate().stop(), this.stopped && this.restore(), a = this.content, f = a.style, g = f.overflowY, d && this.$content.css({
                height: this.$content.height()
            }), b = a.scrollHeight + e, l = parseInt(this.$el.css("max-height"), 10), l > 0 && (this.$el.height(""), this.$el.height(a.scrollHeight > l ? l : a.scrollHeight)), i = this.pane.outerHeight(!1), k = parseInt(this.pane.css("top"), 10), h = parseInt(this.pane.css("bottom"), 10), j = i + k + h, n = Math.round(j / b * i), n < this.options.sliderMinHeight ? n = this.options.sliderMinHeight : null != this.options.sliderMaxHeight && n > this.options.sliderMaxHeight && (n = this.options.sliderMaxHeight), g === t && f.overflowX !== t && (n += e), this.maxSliderTop = j - n, this.contentHeight = b, this.paneHeight = i, this.paneOuterHeight = j, this.sliderHeight = n, this.paneTop = k, this.slider.height(n), this.events.scroll(), this.pane.show(), this.isActive = !0, a.scrollHeight === a.clientHeight || this.pane.outerHeight(!0) >= a.scrollHeight && g !== t ? (this.pane.hide(), this.isActive = !1) : this.el.clientHeight === a.scrollHeight && g === t ? this.slider.hide() : this.slider.show(), this.pane.css({
                opacity: this.options.alwaysVisible ? 1 : "",
                visibility: this.options.alwaysVisible ? "visible" : ""
            }), c = this.$content.css("position"), ("static" === c || "relative" === c) && (m = parseInt(this.$content.css("right"), 10), m && this.$content.css({
                right: "",
                marginRight: m
            })), this)
        }, j.prototype.scroll = function() {
            return this.isActive ? (this.sliderY = Math.max(0, this.sliderY), this.sliderY = Math.min(this.maxSliderTop, this.sliderY), this.$content.scrollTop(this.maxScrollTop * this.sliderY / this.maxSliderTop), this.iOSNativeScrolling || (this.updateScrollValues(), this.setOnScrollStyles()), this) : void 0
        }, j.prototype.scrollBottom = function(a) {
            return this.isActive ? (this.$content.scrollTop(this.contentHeight - this.$content.height() - a).trigger(p), this.stop().restore(), this) : void 0
        }, j.prototype.scrollTop = function(a) {
            return this.isActive ? (this.$content.scrollTop(+a).trigger(p), this.stop().restore(), this) : void 0
        }, j.prototype.scrollTo = function(a) {
            return this.isActive ? (this.scrollTop(this.$el.find(a).get(0).offsetTop), this) : void 0
        }, j.prototype.stop = function() {
            return y && this.scrollRAF && (y(this.scrollRAF), this.scrollRAF = null), this.stopped = !0, this.removeEvents(), this.iOSNativeScrolling || this.pane.hide(), this
        }, j.prototype.destroy = function() {
            return this.stopped || this.stop(), !this.iOSNativeScrolling && this.pane.length && this.pane.remove(), d && this.$content.height(""), this.$content.removeAttr("tabindex"), this.$el.hasClass("has-scrollbar") && (this.$el.removeClass("has-scrollbar"), this.$content.css({
                right: ""
            })), this
        }, j.prototype.flash = function() {
            return !this.iOSNativeScrolling && this.isActive ? (this.reset(), this.pane.addClass("flashed"), setTimeout(function(a) {
                return function() {
                    a.pane.removeClass("flashed")
                }
            }(this), this.options.flashDelay), this) : void 0
        }, j
    }(), a.fn.nanoScroller = function(b) {
        return this.each(function() {
            var c, d;
            if ((d = this.nanoscroller) || (c = a.extend({}, z, b), this.nanoscroller = d = new q(this, c)), b && "object" == typeof b) {
                if (a.extend(d.options, b), null != b.scrollBottom) return d.scrollBottom(b.scrollBottom);
                if (null != b.scrollTop) return d.scrollTop(b.scrollTop);
                if (b.scrollTo) return d.scrollTo(b.scrollTo);
                if ("bottom" === b.scroll) return d.scrollBottom(0);
                if ("top" === b.scroll) return d.scrollTop(0);
                if (b.scroll && b.scroll instanceof a) return d.scrollTo(b.scroll);
                if (b.stop) return d.stop();
                if (b.destroy) return d.destroy();
                if (b.flash) return d.flash()
            }
            return d.reset()
        })
    }, a.fn.nanoScroller.Constructor = q
});
/* REQUIRED PLUGINS
/*! ========================================================================
* metismenu - v2.5.2
* A jQuery menu plugin
* https://github.com/onokumus/metisMenu#readme
*
* Made by Osman Nuri Okumuş <onokumus@gmail.com> (https://github.com/onokumus)
* Under MIT License
*/
! function(n, i) {
    if ("function" == typeof define && define.amd) define(["jquery"], i);
    else if ("undefined" != typeof exports) i(require("jquery"));
    else {
        var e = {
            exports: {}
        };
        i(n.jquery), n.metisMenu = e.exports
    }
}(this, function(n) {
    "use strict";

    function i(n) {
        return n && n.__esModule ? n : {
            "default": n
        }
    }

    function e(n, i) {
        if (!(n instanceof i)) throw new TypeError("Cannot call a class as a function")
    }
    var t = (i(n), "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(n) {
            return typeof n
        } : function(n) {
            return n && "function" == typeof Symbol && n.constructor === Symbol ? "symbol" : typeof n
        }),
        o = function() {
            function n(n, i) {
                for (var e = 0; e < i.length; e++) {
                    var t = i[e];
                    t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t)
                }
            }
            return function(i, e, t) {
                return e && n(i.prototype, e), t && n(i, t), i
            }
        }();
    (function(n) {
        function i() {
            return {
                bindType: _.end,
                delegateType: _.end,
                handle: function(i) {
                    return n(i.target).is(this) ? i.handleObj.handler.apply(this, arguments) : void 0
                }
            }
        }

        function s() {
            if (window.QUnit) return !1;
            var n = document.createElement("mm");
            for (var i in T)
                if (void 0 !== n.style[i]) return {
                    end: T[i]
                };
            return !1
        }

        function a(i) {
            var e = this,
                t = !1;
            n(this).one(v.TRANSITION_END, function() {
                t = !0
            }), setTimeout(function() {
                t || v.triggerTransitionEnd(e)
            }, i)
        }

        function r() {
            _ = s(), v.supportsTransitionEnd() && (n.event.special[v.TRANSITION_END] = i())
        }
        var l = "metisMenu",
            f = "metisMenu",
            c = "." + f,
            d = ".data-api",
            u = n.fn[l],
            h = 350,
            g = {
                toggle: !0,
                doubleTapToGo: !1,
                preventDefault: !0,
                activeClass: "active",
                collapseClass: "collapse",
                collapseInClass: "in",
                collapsingClass: "collapsing"
            },
            p = {
                SHOW: "show" + c,
                SHOWN: "shown" + c,
                HIDE: "hide" + c,
                HIDDEN: "hidden" + c,
                CLICK_DATA_API: "click" + c + d
            },
            _ = !1,
            T = {
                WebkitTransition: "webkitTransitionEnd",
                MozTransition: "transitionend",
                OTransition: "oTransitionEnd otransitionend",
                transition: "transitionend"
            },
            v = {
                TRANSITION_END: "mmTransitionEnd",
                triggerTransitionEnd: function(i) {
                    n(i).trigger(_.end)
                },
                supportsTransitionEnd: function() {
                    return Boolean(_)
                }
            };
        r();
        var C = function() {
            function i(n, t) {
                e(this, i), this._element = n, this._config = this._getConfig(t), this._transitioning = null, this.init()
            }
            return o(i, [{
                key: "init",
                value: function() {
                    var i = this;
                    n(this._element).find("li." + this._config.activeClass).has("ul").children("ul").attr("aria-expanded", !0).addClass(this._config.collapseClass + " " + this._config.collapseInClass), n(this._element).find("li").not("." + this._config.activeClass).has("ul").children("ul").attr("aria-expanded", !1).addClass(this._config.collapseClass), this._config.doubleTapToGo && n(this._element).find("li." + this._config.activeClass).has("ul").children("a").addClass("doubleTapToGo"), n(this._element).find("li").has("ul").children("a").on(p.CLICK_DATA_API, function(e) {
                        var t = n(this),
                            o = t.parent("li"),
                            s = o.children("ul");
                        return i._config.preventDefault && e.preventDefault(), "true" !== t.attr("aria-disabled") ? (o.hasClass(i._config.activeClass) && !i._config.doubleTapToGo ? (t.attr("aria-expanded", !1), i._hide(s)) : (i._show(s), t.attr("aria-expanded", !0)), i._config.onTransitionStart && i._config.onTransitionStart(e), i._config.doubleTapToGo && i._doubleTapToGo(t) && "#" !== t.attr("href") && "" !== t.attr("href") ? (e.stopPropagation(), void(document.location = t.attr("href"))) : void 0) : void 0
                    })
                }
            }, {
                key: "_show",
                value: function(i) {
                    if (!this._transitioning && !n(i).hasClass(this._config.collapsingClass)) {
                        var e = this,
                            t = n(i);
                        if (t.length) {
                            var o = n.Event(p.SHOW);
                            if (t.trigger(o), !o.isDefaultPrevented()) {
                                t.parent("li").addClass(this._config.activeClass), this._config.toggle && this._hide(t.parent("li").siblings().children("ul." + this._config.collapseInClass).attr("aria-expanded", !1)), t.removeClass(this._config.collapseClass).addClass(this._config.collapsingClass).height(0), this.setTransitioning(!0);
                                var s = function() {
                                    t.removeClass(e._config.collapsingClass).addClass(e._config.collapseClass + " " + e._config.collapseInClass).height("").attr("aria-expanded", !0), e.setTransitioning(!1), t.trigger(p.SHOWN)
                                };
                                if (!v.supportsTransitionEnd()) return void s();
                                t.height(t[0].scrollHeight).one(v.TRANSITION_END, s), a(h)
                            }
                        }
                    }
                }
            }, {
                key: "_hide",
                value: function(i) {
                    if (!this._transitioning && n(i).hasClass(this._config.collapseInClass)) {
                        var e = this,
                            t = n(i);
                        if (t.length) {
                            var o = n.Event(p.HIDE);
                            if (t.trigger(o), !o.isDefaultPrevented()) {
                                t.parent("li").removeClass(this._config.activeClass), t.height(t.height())[0].offsetHeight, t.addClass(this._config.collapsingClass).removeClass(this._config.collapseClass).removeClass(this._config.collapseInClass), this.setTransitioning(!0);
                                var s = function() {
                                    e._transitioning && e._config.onTransitionEnd && e._config.onTransitionEnd(), e.setTransitioning(!1), t.trigger(p.HIDDEN), t.removeClass(e._config.collapsingClass).addClass(e._config.collapseClass).attr("aria-expanded", !1)
                                };
                                if (!v.supportsTransitionEnd()) return void s();
                                0 == t.height() || "none" == t.css("display") ? s() : t.height(0).one(v.TRANSITION_END, s), a(h)
                            }
                        }
                    }
                }
            }, {
                key: "_doubleTapToGo",
                value: function(i) {
                    return i.hasClass("doubleTapToGo") ? (i.removeClass("doubleTapToGo"), !0) : i.parent().children("ul").length ? (n(this._element).find(".doubleTapToGo").removeClass("doubleTapToGo"), i.addClass("doubleTapToGo"), !1) : void 0
                }
            }, {
                key: "setTransitioning",
                value: function(n) {
                    this._transitioning = n
                }
            }, {
                key: "_getConfig",
                value: function(i) {
                    return i = n.extend({}, g, i)
                }
            }], [{
                key: "_jQueryInterface",
                value: function(e) {
                    return this.each(function() {
                        var o = n(this),
                            s = o.data(f),
                            a = n.extend({}, g, o.data(), "object" === ("undefined" == typeof e ? "undefined" : t(e)) && e);
                        if (s || (s = new i(this, a), o.data(f, s)), "string" == typeof e) {
                            if (void 0 === s[e]) throw new Error('No method named "' + e + '"');
                            s[e]()
                        }
                    })
                }
            }]), i
        }();
        return n.fn[l] = C._jQueryInterface, n.fn[l].Constructor = C, n.fn[l].noConflict = function() {
            return n.fn[l] = u, C._jQueryInterface
        }, C
    })(jQuery)
});
/* ========================================================================
 * INITIALIZED
 * -------------------------------------------------------------------------
 * - themeOn.net -
 * ========================================================================*/
! function($) {
    "use strict";
    $(document).ready(function() {
        $(document).trigger('nifty.ready');
    });
    $(document).on('nifty.ready', function() {
        //Activate the Bootstrap tooltips
        var tooltip = $('.add-tooltip');
        if (tooltip.length) tooltip.tooltip();
        var popover = $('.add-popover');
        if (popover.length) popover.popover();
        // Update nancoscroller
        $('#navbar-container .navbar-top-links').on('shown.bs.dropdown', '.dropdown', function() {
            $(this).find('.nano').nanoScroller({
                preventPageScrolling: true
            });
        });
        $.niftyNav('bind');
        // $.niftyAside('bind');
    });
}(jQuery);
/* ========================================================================
 * MEGA DROPDOWN v1.2
 * ------------------------------------------------------------------------
 * Nifty Exclusive Plugins - ThemeOn.net
 * -------------------------------------------------------------------------
 *
 * OPTIONAL PLUGINS.
 * You may choose whether to include it in your project or not.
 *
 * ========================================================================*/
// ! function($) {
//     "use strict";
//     var megadropdown = null,
//         mega = function(el) {
//             var megaBtn = el.find('.mega-dropdown-toggle'),
//                 megaMenu = el.find('.mega-dropdown-menu');
//             megaBtn.on('click', function(e) {
//                 e.preventDefault();
//                 el.toggleClass('open');
//             });
//         },
//         methods = {
//             toggle: function() {
//                 this.toggleClass('open');
//                 return null;
//             },
//             show: function() {
//                 this.addClass('open');
//                 return null;
//             },
//             hide: function() {
//                 this.removeClass('open');
//                 return null;
//             }
//         };
//     $.fn.niftyMega = function(method) {
//         var chk = false;
//         this.each(function() {
//             if (methods[method]) {
//                 chk = methods[method].apply($(this).find('input'), Array.prototype.slice.call(arguments, 1));
//             } else if (typeof method === 'object' || !method) {
//                 mega($(this));
//             };
//         });
//         return chk;
//     };
//     $(document).on('nifty.ready', function() {
//         megadropdown = $('.mega-dropdown');
//         if (megadropdown.length) {
//             megadropdown.niftyMega();
//             $('html').on('click', function(e) {
//                 if (!$(e.target).closest('.mega-dropdown').length) {
//                     megadropdown.removeClass('open');
//                 }
//             });
//         };
//     });
// }(jQuery);
/* ========================================================================
 * PANEL REMOVAL v1.1
 * -------------------------------------------------------------------------
 * Nifty Exclusive Plugins - ThemeOn.net
 * -------------------------------------------------------------------------
 *
 * OPTIONAL PLUGINS.
 * You may choose whether to include it in your project or not.
 *
 * ========================================================================*/
// ! function($) {
//     "use strict";
//     $(document).on('nifty.ready', function() {
//         var closebtn = $('[data-dismiss="panel"]');
//         if (closebtn.length) {
//             closebtn.one('click', function(e) {
//                 e.preventDefault();
//                 var el = $(this).parents('.panel');
//                 el.addClass('remove').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
//                     if (e.originalEvent.propertyName == "opacity") {
//                         el.remove();
//                     }
//                 });
//             });
//         } else {
//             closebtn = null
//         }
//     });
// }(jQuery);
/* ========================================================================
 * SCROLL TO TOP BUTTON v1.3
 * -------------------------------------------------------------------------
 * Nifty Exclusive Plugins - ThemeOn.net
 * -------------------------------------------------------------------------
 *
 * OPTIONAL PLUGINS.
 * You may choose whether to include it in your project or not.
 *
 * ========================================================================*/
! function($) {
    "use strict";
    $(document).one('nifty.ready', function() {
        var niftyScrollTop = $('.scroll-top'),
            niftyWindow = $(window),
            isMobile = function() {
                return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
            }();
        if (niftyScrollTop.length && !isMobile) {
            var isVisible = false;
            var offsetTop = 250;

            function calcScroll() {
                if (niftyWindow.scrollTop() > offsetTop && !isVisible) {
                    niftyScrollTop.addClass('in').stop(true, true).css({
                        'animation': 'none'
                    }).show(0).css({
                        "animation": "jellyIn .8s"
                    });
                    isVisible = true;
                } else if (niftyWindow.scrollTop() < offsetTop && isVisible) {
                    niftyScrollTop.removeClass('in');
                    isVisible = false;
                }
            };
            calcScroll();
            niftyWindow.scroll(calcScroll);
            niftyScrollTop.on('click', function(e) {
                e.preventDefault();
                $('body, html').animate({
                    scrollTop: 0
                }, 500);
            });
        } else {
            niftyScrollTop = null;
            niftyWindow = null;
        }
        isMobile = null;
    });
}(jQuery)

/* ========================================================================
 * NAVIGATION SHORTCUT BUTTONS
 * -------------------------------------------------------------------------
 * Nifty Exclusive Plugins - ThemeOn.net
 * -------------------------------------------------------------------------
 *
 * OPTIONAL PLUGINS.
 * You may choose whether to include it in your project or not.
 *
 * ========================================================================*/
! function($) {
    $(document).on('nifty.ready', function() {
        var shortcutBtn = $('#mainnav-shortcut');
        if (shortcutBtn.length) {
            shortcutBtn.find('li').each(function() {
                var $el = $(this);
                $el.popover({
                    animation: false,
                    trigger: 'hover',
                    placement: 'bottom',
                    container: '#mainnav-container',
                    viewport: '#mainnav-container',
                    template: '<div class="popover mainnav-shortcut"><div class="arrow"></div><div class="popover-content"></div>'
                });
            });
        } else {
            shortcutBtn = null;
        }
    });
}(jQuery);
/* ========================================================================
 * NIFTY NAVIGATION v1.5
 * -------------------------------------------------------------------------
 * Nifty Exclusive Plugins - ThemeOn.net
 * -------------------------------------------------------------------------
 *
 * OPTIONAL PLUGINS.
 * You may choose whether to include it in your project or not.
 * Remove it if you don't use the Main Navigation.
 * ========================================================================
 *
 * REQUIRE BOOTSTRAP POPOVER
 * http://getbootstrap.com/javascript/#popovers
 *
 * REQUIRE JQUERY RESIZEEND
 * https://github.com/nielse63/jQuery-ResizeEnd
 *
 * ========================================================================*/
/*! jQuery resizeEnd Event v1.0.1 - Copyright (c) 2013 Giuseppe Gurgone - License http://git.io/iRQs3g */
// ! function($, e) {
//     var t = {};
//     t.eventName = "resizeEnd", t.delay = 250, t.poll = function() {
//         var n = $(this),
//             a = n.data(t.eventName);
//         a.timeoutId && e.clearTimeout(a.timeoutId), a.timeoutId = e.setTimeout(function() {
//             n.trigger(t.eventName)
//         }, t.delay)
//     }, $.event.special[t.eventName] = {
//         setup: function() {
//             var e = $(this);
//             e.data(t.eventName, {}), e.on("resize", t.poll)
//         },
//         teardown: function() {
//             var n = $(this),
//                 a = n.data(t.eventName);
//             a.timeoutId && e.clearTimeout(a.timeoutId), n.removeData(t.eventName), n.off("resize", t.poll)
//         }
//     }, $.fn[t.eventName] = function(e, n) {
//         return arguments.length > 0 ? this.on(t.eventName, null, e, n) : this.trigger(t.eventName)
//     }
// }(jQuery, this);
! function($) {
    "use strict";
    var $menulink = null,
        niftyContainer = null,
        boxedContainer = null,
        niftyMainNav = null,
        mainNavHeight = null,
        scrollbar = null,
        updateMethod = false,
        isSmallNav = false,
        screenSize = null,
        screenCat = null,
        defaultSize = null,
        niftyWindow = $(window),
        ignoreAffix = false,
        // Determine and bind hover or "touch" event
        // ===============================================
        bindSmallNav = function() {
            var hidePopover, $menulink = $('#mainnav-menu > li > a, #mainnav-menu-wrap .mainnav-widget a[data-toggle="menu-widget"]');
            $menulink.each(function() {
                var $el = $(this),
                    $listTitle = $el.children('.menu-title'),
                    $listSub = $el.siblings('.collapse'),
                    $listWidget = $($el.attr('data-target')),
                    $listWidgetParent = ($listWidget.length) ? $listWidget.parent() : null,
                    $popover = null,
                    $poptitle = null,
                    $popcontent = null,
                    $popoverSub = null,
                    popoverPosBottom = 0,
                    popoverCssBottom = 0,
                    elPadding = $el.outerHeight() - $el.height() / 4,
                    listSubScroll = false,
                    elHasSub = function() {
                        if ($listWidget.length) {
                            $el.on('click', function(e) {
                                e.preventDefault()
                            });
                        }
                        if ($listSub.length) {
                            //$listSub.removeClass('in').removeAttr('style');
                            $el.on('click', function(e) {
                                e.preventDefault()
                            }).parent('li').removeClass('active');
                            return true;
                        } else {
                            return false;
                        }
                    }(),
                    updateScrollInterval = null,
                    updateScrollBar = function(el) {
                        clearInterval(updateScrollInterval);
                        updateScrollInterval = setInterval(function() {
                            el.nanoScroller({
                                preventPageScrolling: true,
                                alwaysVisible: true
                            });
                            clearInterval(updateScrollInterval);
                        }, 100);
                    };
                $(document).click(function(event) {
                    if (!$(event.target).closest('#mainnav-container').length) {
                        $el.removeClass('hover').popover('hide');
                    }
                });
                $('#mainnav-menu-wrap > .nano').on("update", function(event, values) {
                    $el.removeClass('hover').popover('hide');
                });
                $el.popover({
                    animation: false,
                    trigger: 'manual',
                    container: '#mainnav',
                    viewport: $el,
                    html: true,
                    title: function() {
                        if (elHasSub) return $listTitle.html();
                        return null
                    },
                    content: function() {
                        var $content;
                        if (elHasSub) {
                            $content = $('<div class="sub-menu"></div>');
                            $listSub.addClass('pop-in').wrap('<div class="nano-content"></div>').parent().appendTo($content);
                        } else if ($listWidget.length) {
                            $content = $('<div class="sidebar-widget-popover"></div>');
                            $listWidget.wrap('<div class="nano-content"></div>').parent().appendTo($content);
                        } else {
                            $content = '<span class="single-content">' + $listTitle.html() + '</span>';
                        }
                        return $content;
                    },
                    template: '<div class="popover menu-popover"><h4 class="popover-title"></h4><div class="popover-content"></div></div>'
                }).on('show.bs.popover', function() {
                    if (!$popover) {
                        $popover = $el.data('bs.popover').tip();
                        $poptitle = $popover.find('.popover-title');
                        $popcontent = $popover.children('.popover-content');
                        if (!elHasSub && $listWidget.length == 0) return;
                        $popoverSub = $popcontent.children('.sub-menu');
                    }
                    if (!elHasSub && $listWidget.length == 0) return;
                }).
                on('shown.bs.popover', function() {
                    if (!elHasSub && $listWidget.length == 0) {
                        var margintop = 0 - (0.5 * $el.outerHeight());
                        $popcontent.css({
                            'margin-top': margintop + 'px',
                            'width': 'auto'
                        });
                        return;
                    }
                    var offsetTop = parseInt($popover.css('top')),
                        elHeight = $el.outerHeight(),
                        offsetBottom = function() {
                            if (niftyContainer.hasClass('mainnav-fixed')) {
                                return $(window).outerHeight() - offsetTop - elHeight;
                            } else {
                                return $(document).height() - offsetTop - elHeight;
                            }
                        }(),
                        popoverHeight = $popcontent.find('.nano-content').children().css('height', 'auto').outerHeight();
                    $popcontent.find('.nano-content').children().css('height', '');
                    if (offsetTop > offsetBottom) {
                        if ($poptitle.length && !$poptitle.is(':visible')) elHeight = Math.round(0 - (0.5 * elHeight));
                        offsetTop -= 5;
                        $popcontent.css({
                            'top': '',
                            'bottom': elHeight + 'px',
                            'height': offsetTop
                        }).children().addClass('nano').css({
                            'width': '100%'
                        }).nanoScroller({
                            preventPageScrolling: true
                        });
                        updateScrollBar($popcontent.find('.nano'));
                    } else {
                        if (!niftyContainer.hasClass('navbar-fixed') && niftyMainNav.hasClass('affix-top')) offsetBottom -= 50;
                        if (popoverHeight > offsetBottom) {
                            if (niftyContainer.hasClass('navbar-fixed') || niftyMainNav.hasClass('affix-top')) offsetBottom -= (elHeight + 5);
                            offsetBottom -= 5;
                            $popcontent.css({
                                'top': elHeight + 'px',
                                'bottom': '',
                                'height': offsetBottom
                            }).children().addClass('nano').css({
                                'width': '100%'
                            }).nanoScroller({
                                preventPageScrolling: true
                            });
                            updateScrollBar($popcontent.find('.nano'));
                        } else {
                            if ($poptitle.length && !$poptitle.is(':visible')) elHeight = Math.round(0 - (0.5 * elHeight));
                            $popcontent.css({
                                'top': elHeight + 'px',
                                'bottom': '',
                                'height': 'auto'
                            });
                        }
                    }
                    if ($poptitle.length) $poptitle.css('height', $el.outerHeight());
                    $popcontent.on('click', function() {
                        $popcontent.find('.nano-pane').hide();
                        updateScrollBar($popcontent.find('.nano'));
                    });
                }).on('click', function() {
                    if (!niftyContainer.hasClass('mainnav-sm')) return;
                    $menulink.popover('hide');
                    $el.addClass('hover').popover('show');
                }).hover(function() {
                    $menulink.popover('hide');
                    $el.addClass('hover').popover('show').one('hidden.bs.popover', function() {
                        // detach from popover, fire event then clean up data
                        $el.removeClass('hover');
                        if (elHasSub) {
                            $listSub.removeAttr('style').appendTo($el.parent());
                        } else if ($listWidget.length) {
                            $listWidget.appendTo($listWidgetParent);
                        }
                        clearInterval(hidePopover);
                    })
                }, function() {
                    clearInterval(hidePopover);
                    hidePopover = setInterval(function() {
                        if ($popover) {
                            $popover.one('mouseleave', function() {
                                $el.removeClass('hover').popover('hide');
                            });
                            if (!$popover.is(":hover")) {
                                $el.removeClass('hover').popover('hide');
                            }
                        };
                        clearInterval(hidePopover);
                    }, 100);
                });
            });
            isSmallNav = true;
        },
        unbindSmallNav = function() {
            var colapsed = $('#mainnav-menu').find('.collapse');
            if (colapsed.length) {
                colapsed.each(function() {
                    var cl = $(this);
                    if (cl.hasClass('in')) {
                        cl.parent('li').addClass('active');
                    } else {
                        cl.parent('li').removeClass('active');
                    }
                });
            }
            /*if(scrollbar != null && scrollbar.length){
                scrollbar.nanoScroller({stop : true});
            }*/
            $menulink.popover('destroy').unbind('mouseenter mouseleave');
            isSmallNav = false;
        },
        updateSize = function() {
            //if(!defaultSize) return;
            var sw = niftyContainer.width(),
                currentScreen;
            if (sw <= 740) {
                currentScreen = 'xs';
            } else if (sw > 740 && sw < 992) {
                currentScreen = 'sm';
            } else if (sw >= 992 && sw <= 1200) {
                currentScreen = 'md';
            } else {
                currentScreen = 'lg';
            }
            if (screenCat != currentScreen) {
                screenCat = currentScreen;
                screenSize = currentScreen;
                if (screenSize == 'sm' && niftyContainer.hasClass('mainnav-lg')) {
                    $.niftyNav('collapse');
                } else if (screenSize == "xs" && niftyContainer.hasClass('mainnav-lg')) {
                    niftyContainer.removeClass('mainnav-sm mainnav-out mainnav-lg').addClass('mainnav-sm');
                } else if (screenSize == "lg") {
                    //$.niftyNav('expand');
                }
            }
        },
        boxedPosition = function() {
            if (niftyContainer.hasClass('boxed-layout') && niftyContainer.hasClass('mainnav-fixed') && boxedContainer.length) {
                niftyMainNav.css({
                    'left': boxedContainer.offset().left + 'px'
                });
            } else {
                niftyMainNav.css({
                    'left': ''
                });
            }
        },
        updateAffix = function() {
            if (!ignoreAffix) {
                try {
                    niftyMainNav.niftyAffix('update');
                } catch (err) {
                    ignoreAffix = true;
                }
            }
        },
        updateNav = function(e) {
            updateAffix();
            unbindSmallNav();
            updateSize();
            boxedPosition();
            if (updateMethod == 'collapse' || niftyContainer.hasClass('mainnav-sm')) {
                niftyContainer.removeClass('mainnav-in mainnav-out mainnav-lg');
                bindSmallNav();
            }
            mainNavHeight = $('#mainnav').height();
            updateMethod = false;
            return null;
        },
        // init = function() {
        //     if (!defaultSize) {
        //         defaultSize = {
        //             xs: 'mainnav-out',
        //             sm: niftyMainNav.data('sm') || niftyMainNav.data('all'),
        //             md: niftyMainNav.data('md') || niftyMainNav.data('all'),
        //             lg: niftyMainNav.data('lg') || niftyMainNav.data('all')
        //         }
        //         var hasData = false;
        //         for (var item in defaultSize) {
        //             if (defaultSize[item]) {
        //                 hasData = true;
        //                 break;
        //             }
        //         }
        //         if (!hasData) defaultSize = null;
        //         updateSize();
        //     }
        // },
        methods = {
            'revealToggle': function() {
                if (!niftyContainer.hasClass('reveal')) niftyContainer.addClass('reveal');
                niftyContainer.toggleClass('mainnav-in mainnav-out').removeClass('mainnav-lg mainnav-sm')
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'revealIn': function() {
                if (!niftyContainer.hasClass('reveal')) niftyContainer.addClass('reveal');
                niftyContainer.addClass('mainnav-in').removeClass('mainnav-out mainnav-lg mainnav-sm');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'revealOut': function() {
                if (!niftyContainer.hasClass('reveal')) niftyContainer.addClass('reveal');
                niftyContainer.removeClass('mainnav-in mainnav-lg mainnav-sm').addClass('mainnav-out');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'slideToggle': function() {
                if (!niftyContainer.hasClass('slide')) niftyContainer.addClass('slide');
                niftyContainer.toggleClass('mainnav-in mainnav-out').removeClass('mainnav-lg mainnav-sm')
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'slideIn': function() {
                if (!niftyContainer.hasClass('slide')) niftyContainer.addClass('slide');
                niftyContainer.addClass('mainnav-in').removeClass('mainnav-out mainnav-lg mainnav-sm');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'slideOut': function() {
                if (!niftyContainer.hasClass('slide')) niftyContainer.addClass('slide');
                niftyContainer.removeClass('mainnav-in mainnav-lg mainnav-sm').addClass('mainnav-out');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'pushToggle': function() {
                niftyContainer.toggleClass('mainnav-in mainnav-out').removeClass('mainnav-lg mainnav-sm');
                if (niftyContainer.hasClass('mainnav-in mainnav-out')) niftyContainer.removeClass('mainnav-in');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'pushIn': function() {
                niftyContainer.addClass('mainnav-in').removeClass('mainnav-out mainnav-lg mainnav-sm');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'pushOut': function() {
                niftyContainer.removeClass('mainnav-in mainnav-lg mainnav-sm').addClass('mainnav-out');
                if (isSmallNav) unbindSmallNav();
                return;
            },
            'colExpToggle': function() {
                if (niftyContainer.hasClass('mainnav-lg mainnav-sm')) niftyContainer.removeClass('mainnav-lg');
                niftyContainer.toggleClass('mainnav-lg mainnav-sm').removeClass('mainnav-in mainnav-out');
                return niftyWindow.trigger('resize');
            },
            'collapse': function() {
                niftyContainer.addClass('mainnav-sm').removeClass('mainnav-lg mainnav-in mainnav-out');
                updateMethod = 'collapse';
                return niftyWindow.trigger('resize');
            },
            'expand': function() {
                niftyContainer.removeClass('mainnav-sm mainnav-in mainnav-out').addClass('mainnav-lg');
                return niftyWindow.trigger('resize');
            },
            'togglePosition': function() {
                niftyContainer.toggleClass('mainnav-fixed');
                updateAffix();
            },
            'fixedPosition': function() {
                niftyContainer.addClass('mainnav-fixed');
                scrollbar.nanoScroller({
                    preventPageScrolling: true
                });
                updateAffix();
            },
            'staticPosition': function() {
                niftyContainer.removeClass('mainnav-fixed');
                scrollbar.nanoScroller({
                    preventPageScrolling: false
                });
                updateAffix();
            },
            'update': updateNav,
            'refresh': updateNav,
            'getScreenSize': function() {
                return screenCat
            },
            'bind': function() {
                var menu = $('#mainnav-menu');
                if (menu.length == 0) return false;
                $menulink = $('#mainnav-menu > li > a, #mainnav-menu-wrap .mainnav-widget a[data-toggle="menu-widget"]');
                niftyContainer = $('#container');
                boxedContainer = niftyContainer.children('.boxed');
                niftyMainNav = $('#mainnav-container');
                mainNavHeight = $('#mainnav').height();
                var transitionNav = null;
                niftyMainNav.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
                    if (transitionNav || e.target === niftyMainNav[0]) {
                        clearInterval(transitionNav);
                        transitionNav = setInterval(function() {
                            $(window).trigger('resize');
                            clearInterval(transitionNav);
                            transitionNav = null;
                        }, 300);
                    }
                });
                var toggleBtn = $('.mainnav-toggle');
                if (toggleBtn.length) {
                    toggleBtn.on('click', function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        if (toggleBtn.hasClass('push')) {
                            $.niftyNav('pushToggle');
                        } else if (toggleBtn.hasClass('slide')) {
                            $.niftyNav('slideToggle');
                        } else if (toggleBtn.hasClass('reveal')) {
                            $.niftyNav('revealToggle');
                        } else {
                            $.niftyNav('colExpToggle');
                        }
                    })
                };
                // COLLAPSIBLE MENU LIST
                // =================================================================
                // Require MetisMenu
                // http://demo.onokumus.com/metisMenu/
                // =================================================================
                try {
                    menu.metisMenu({
                        toggle: true
                    });
                } catch (err) {
                    console.error(err.message);
                }
                // STYLEABLE SCROLLBARS
                // =================================================================
                // Require nanoScroller
                // http://jamesflorentino.github.io/nanoScrollerJS/
                // =================================================================
                try {
                    scrollbar = $('#mainnav-menu-wrap > .nano');
                    if (scrollbar.length) scrollbar.nanoScroller({
                        preventPageScrolling: (niftyContainer.hasClass('mainnav-fixed') ? true : false)
                    });
                } catch (err) {
                    console.error(err.message);
                }
                $(window).on('resizeEnd', updateNav).trigger('resize');
            }
        };
    $.niftyNav = function(method, complete) {
        if (methods[method]) {
            if (method == 'colExpToggle' || method == 'expand' || method == 'collapse') {
                if (screenSize == 'xs' && method == 'collapse') {
                    method = 'pushOut';
                } else if ((screenSize == 'xs' || screenSize == 'sm') && (method == 'colExpToggle' || method == 'expand') && niftyContainer.hasClass('mainnav-sm')) {
                    method = 'pushIn';
                }
            }
            var val = methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
            if (method != 'bind') updateNav();
            if (complete) return complete();
            else if (val) return val;
        }
        return null;
    };
    // $.fn.isOnScreen = function() {
    //     var viewport = {
    //         top: niftyWindow.scrollTop(),
    //         left: niftyWindow.scrollLeft()
    //     };
    //     viewport.right = viewport.left + niftyWindow.width();
    //     viewport.bottom = viewport.top + niftyWindow.height();
    //     var bounds = this.offset();
    //     bounds.right = bounds.left + this.outerWidth();
    //     bounds.bottom = bounds.top + this.outerHeight();
    //     return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.bottom || viewport.top > bounds.top));
    // };
}(jQuery);


